<!DOCTYPE html>
<html>
<include file="Public:header" />
<link href="__ACSS__/dialog.css" rel="stylesheet">
<link rel="stylesheet" href="__ACSS__/plugins/zTree/zTreeStyle.css" type="text/css">
<link href="__ACSS__/plugins/validform/validform.css" rel="stylesheet">
<style>
.purchase-box span{ cursor:pointer; margin:10px 10px 5px 0; border:1px solid #ddd; padding:3px 13px; border-radius:4px; float:left; background:#fff; font-size:16px; position:relative;}
.purchase-box span:hover,.purchase-box span.on{ border:1px solid #777; background:#eee;}
.purchase-box span:active{ border:1px solid #666; background:#d1d1d1;}
.purchase-box span i{ display:none;}
.purchase-box span.on i{ display:block; position:absolute; bottom:0; right:1px; font-size:0.7em; color:#777;}
.purchase-box span b{ display:block; position:absolute; top:2px; right:4px; font-size:0.8em; color:red;}
.purchase-box{ background:#f7f7f9; border:1px solid #e1e1e8; border-radius:4px; margin:20px 0 20px 0; padding-top:10px; padding-bottom:15px;}
.wrapper{ padding-bottom:60px;}
</style>
<body>
	<form role="form" class="form" action="__URL__/city">
	    <div class="wrapper wrapper-content animated fadeInRight">
	    	<div role="alert" class="alert alert-info" style="line-height:24px;"><strong>城市编号建议使用该城市的邮政编号。<br/>城市名请规范命名，如：建德市、西湖区、桐庐县，都可作为城市名。</strong></div>
			<div class="form-group">
				<label class="col-sm-2 control-label">省份：</label>
				<div class="col-sm-10">
					<select class="form-control" datatype="*" name="type_code" id="type-code" onchange="changeSelect(this)">
						<foreach name="vo" item="vo">
							<option value="<{$vo.id}>"><{$vo.province}></option>
						</foreach>
				    </select>
				</div>
			</div>
			<div class="form-box">
				<div class="form-group">
					<label class="col-sm-2 control-label">城市编号：</label>
					<div class="col-sm-10">
						<input type="text" datatype="*" name="city" id="city" class="form-control" placeholder="城市编号，推荐使用城市邮政编号" ajaxurl="__URL__/checkCity">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">城市名：</label>
					<div class="col-sm-10">
						<input type="text" datatype="*" name="city_name" id="city_name" class="form-control" placeholder="城市名" ajaxurl="__URL__/checkCityName">
					</div>
				</div>
			</div>
			<div class="clearfix"></div>
	    </div>
	    <div class="footer-bar">
	    	<div class="clearfix">
	    		<input type="hidden" class="purchase-list" value=""/>
				<button type="submit" id="submit-btn" class="btn btn-success btn-block">提交</button>
			</div>
	    </div>
    </form>
</body>
<!-- 全局js -->
<include file="Public:foot" />
<script src="__AJSPLUGINS__/validform/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
var form = $(".form").Validform({
	tiptype:4,
	ajaxPost:true,
	beforeSubmit:function(curform){
		var index = parent.layer.getFrameIndex(window.name);
		var str = $("#type-code").find("option:selected").val()+"_"+$("#city").val()+"_"+$("#city_name").val();
		parent.getItem(str);
		parent.layer.close(index);
		return false;
	},
	callback:function(data){
		if(data.status == 1) {
			window.parent.layer.msg(data.info);
			window.parent.$('#table_list').trigger("reloadGrid");
			parent.layer.close(index);
		}else{
			window.parent.layer.msg(data.info);
		}
	}
});
</script>
</html>